//
//  UIView+WXFrame.m
//  一点互助
//
//  Created by 王勇 on 16/8/26.
//  Copyright © 2016年 王勇. All rights reserved.
//

#import "UIView+WXFrame.h"

@implementation UIView (WXFrame)

-(void)setFrameX:(CGFloat)frameX{
    CGRect frame = self.frame;
    frame.origin.x = frameX;
    self.frame = frame;
}

-(CGFloat)frameX{
    return self.frame.origin.x;
}

-(void)setFrameY:(CGFloat)frameY{
    CGRect frame = self.frame;
    frame.origin.y = frameY;
    self.frame = frame;
}

-(CGFloat)frameY{
    return self.frame.origin.y;
}

-(void)setBoundsX:(CGFloat)boundsX{
    CGRect bounds = self.bounds;
    bounds.origin.x = boundsX;
    self.bounds = bounds;
}

-(CGFloat)boundsX{
    return self.bounds.origin.x;
}

-(void)setBoundsY:(CGFloat)boundsY{
    CGRect bounds = self.bounds;
    bounds.origin.y = boundsY;
    self.bounds = bounds;
}

-(CGFloat)boundsY{
    return self.bounds.origin.y;
}

-(void)setCenterX:(CGFloat)centerX{
    CGPoint center = self.center;
    center.x = centerX;
    self.center = center;
}

-(CGFloat)centerX{
    return self.center.x;
}

-(void)setCenterY:(CGFloat)centerY{
    CGPoint center = self.center;
    center.y = centerY;
    self.center = center;
}

-(CGFloat)centerY{
    return self.center.y;
}

-(void)setWidth:(CGFloat)width{
    CGRect bounds = self.bounds;
    bounds.size.width = width;
    self.bounds = bounds;
}

-(CGFloat)width{
    return self.frame.size.width;
}

-(void)setHeight:(CGFloat)height{
    
    CGRect frame= self.frame;
    frame.size.height = height;
    self.frame = frame;

}

-(CGFloat)height{
    return self.frame.size.height;
}
@end
